package com.training1.core.tree.misc;

import java.math.BigDecimal;

public class TreeNodeDto implements Comparable<TreeNodeDto> {
	private int id;
	private long enterTime;
	private String nodeNumber;
	private String owner;
	private String recommender;
	private String cellPhone;
	private String recommenderCellPhone;
	private String cardNumber;
	private int nodeIndex;
	private int wellIndex;
	private int viewIndex;
	private int level;
	private MiddleNodeType middleAreaNodeType;
	private String parentNodeNumber;
	private NodeType nodeType;
	private Integer useGiftCard;
	private BigDecimal rewardLevelOne;
	private BigDecimal rewardLevelTwo;
	private BigDecimal rewardLevelThree;
	private BigDecimal rewardByRecommend;
	private Integer numOfRecommendations;
	private boolean newNode;

	public String getCardNumber() {
		return cardNumber;
	}

	public void setCardNumber(String cardNumber) {
		this.cardNumber = cardNumber;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public long getEnterTime() {
		return enterTime;
	}

	public void setEnterTime(long enterTime) {
		this.enterTime = enterTime;
	}

	public String getNodeNumber() {
		return nodeNumber;
	}

	public void setNodeNumber(String nodeNumber) {
		this.nodeNumber = nodeNumber;
	}

	public String getOwner() {
		return owner;
	}

	public void setOwner(String owner) {
		this.owner = owner;
	}

	public String getRecommender() {
		return recommender;
	}

	public void setRecommender(String recommender) {
		this.recommender = recommender;
	}

	public String getCellPhone() {
		return cellPhone;
	}

	public void setCellPhone(String cellPhone) {
		this.cellPhone = cellPhone;
	}

	public String getRecommenderCellPhone() {
		return recommenderCellPhone;
	}

	public void setRecommenderCellPhone(String recommenderCellPhone) {
		this.recommenderCellPhone = recommenderCellPhone;
	}

	public int getNodeIndex() {
		return nodeIndex;
	}

	public void setNodeIndex(int nodeIndex) {
		this.nodeIndex = nodeIndex;
	}

	public int getWellIndex() {
		return wellIndex;
	}

	public void setWellIndex(int wellIndex) {
		this.wellIndex = wellIndex;
	}

	public int getViewIndex() {
		return viewIndex;
	}

	public void setViewIndex(int viewIndex) {
		this.viewIndex = viewIndex;
	}

	public int getLevel() {
		return level;
	}

	public void setLevel(int level) {
		this.level = level;
	}

	public NodeType getNodeType() {
		return nodeType;
	}

	public void setNodeType(NodeType nodeType) {
		this.nodeType = nodeType;
	}

	public Integer getUseGiftCard() {
		return useGiftCard;
	}

	public void setUseGiftCard(Integer useGiftCard) {
		this.useGiftCard = useGiftCard;
	}

	public BigDecimal getRewardLevelOne() {
		return rewardLevelOne;
	}

	public void setRewardLevelOne(BigDecimal rewardLevelOne) {
		this.rewardLevelOne = rewardLevelOne;
	}

	public BigDecimal getRewardLevelTwo() {
		return rewardLevelTwo;
	}

	public void setRewardLevelTwo(BigDecimal rewardLevelTwo) {
		this.rewardLevelTwo = rewardLevelTwo;
	}

	public BigDecimal getRewardLevelThree() {
		return rewardLevelThree;
	}

	public void setRewardLevelThree(BigDecimal rewardLevelThree) {
		this.rewardLevelThree = rewardLevelThree;
	}

	public BigDecimal getRewardByRecommend() {
		return rewardByRecommend;
	}

	public void setRewardByRecommend(BigDecimal rewardByRecommend) {
		this.rewardByRecommend = rewardByRecommend;
	}

	public Integer getNumOfRecommendations() {
		return numOfRecommendations;
	}

	public void setNumOfRecommendations(Integer numOfRecommendations) {
		this.numOfRecommendations = numOfRecommendations;
	}

	public boolean isNewNode() {
		return newNode;
	}

	public void setNewNode(boolean newNode) {
		this.newNode = newNode;
	}

	public MiddleNodeType getMiddleAreaNodeType() {
		return middleAreaNodeType;
	}

	public void setMiddleAreaNodeType(MiddleNodeType middleAreaNodeType) {
		this.middleAreaNodeType = middleAreaNodeType;
	}

	public String getParentNodeNumber() {
		return parentNodeNumber;
	}

	public void setParentNodeNumber(String parentNodeNumber) {
		this.parentNodeNumber = parentNodeNumber;
	}

	@Override
	public int compareTo(TreeNodeDto node) {
		// 升序排列，最近的日期订单在最后面
		if (node.getEnterTime() > this.getEnterTime()) {
			return -1;
		} else if (node.getEnterTime() < this.getEnterTime()) {
			return 1;
		} else {
			return 0;
		}
	}
}
